<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-cascades"></i> 厂家档案管理
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div class="handle-box">
                <el-input v-model="query.manuName" placeholder="厂家名称" class="handle-input mr10"
                          @keyup.enter.native="handleSearch" style="width: 12%"></el-input>
                <el-input v-model="query.manuAdr" placeholder="厂家地址" class="handle-input mr10"
                          @keyup.enter.native="handleSearch" style="width: 12%"></el-input>
                <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                <el-button type="el-button" icon="el-icon-delete" @click="handleReset">重置</el-button>
                <div class="right-items" style="float: right;" v-if="roleId!=='view'">
                    <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
                </div>
                <div class="right-items" style="float: right;margin-right: 20px">
                    <el-button type="primary" icon="el-icon-download" @click="handleLoading">导出</el-button>
                </div>
            </div>
            <el-table
                    :data="tableData"
                    border
                    class="table"
                    ref="multipleTable"
                    header-cell-class-name="table-header"
                    @selection-change="handleSelectionChange"
            >
                <el-table-column
                        type="selection"
                        width="60">
                </el-table-column>
                <el-table-column prop="manuId" label="厂家编号" align="center" width="200"></el-table-column>
                <el-table-column prop="manuName" label="厂家名称" align="center"></el-table-column>
                <el-table-column prop="manuAdr" label="厂家地址" align="center"></el-table-column>
                <el-table-column prop="createdAccount" label="创建人" align="center" width="120"></el-table-column>
                <el-table-column prop="createdTime" label="创建时间" align="center" width="160" sortable></el-table-column>
                <el-table-column label="厂家联系人" align="center" width="100">
                    <template slot-scope="scope">
                        <el-link type="primary" @click="contactsList(scope.$index, scope.row)"
                        >操作
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column label="厂家资质" align="center" width="100">
                    <template slot-scope="scope">
                        <el-link type="primary" @click="pictureList(scope.$index, scope.row)"
                        >操作
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column label="供应商信息" align="center" width="100">
                    <template slot-scope="scope">
                        <el-link type="primary" @click="supplierList(scope.$index, scope.row)"
                        >操作
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column label="产品信息" align="center" width="100">
                    <template slot-scope="scope">
                        <el-link type="primary" @click="productList(scope.$index, scope.row)"
                        >查看
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column label="操作" align="center" v-if="roleId!=='view'" width="120">
                    <template slot-scope="scope">
                        <el-button
                                type="text"
                                icon="el-icon-edit"
                                @click="handleEdit(scope.$index, scope.row)"
                        >编辑
                        </el-button>
                        <el-button
                                type="text"
                                icon="el-icon-delete"
                                class="red"
                                @click="handleDelete(scope.$index, scope.row)"
                        >删除
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="pagination">
                <el-pagination
                        background
                        layout="total, prev, pager, next"
                        :current-page="query.pageIndex"
                        :page-size="query.pageSize"
                        :total="pageTotal"
                        @current-change="handlePageChange"
                ></el-pagination>
            </div>
        </div>

        <el-dialog title="图片" :visible.sync="showImg" width="50%" :show-close="false">
            <div>
                　
                <BigImg v-if="showImg" @clickit="viewImg" :imgSrc="imgSrc"></BigImg>
            </div>
        </el-dialog>

        <!-- 新增弹出框 -->
        <el-dialog title="新增" :visible.sync="addVisible" width="40%" :before-close="closeAdd">
            <el-form ref="addForm" :rules="formRules" :model="addForm" label-width="90px">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="厂家名称:" prop="manuName">
                            <el-input v-model="addForm.manuName"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="厂家地址:" prop="manuAdr">
                            <el-input v-model="addForm.manuAdr"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col style="margin-left: 90px;margin-bottom: 14px">
                        <el-button type="primary" @click="addLine()">添加行数</el-button>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="厂家联系人:" prop="srmContactsEntitys">
                        <el-table :data="srmContactsList" style="width: 100%"
                                  border>
                            <el-table-column prop="conName" label="姓名" align="center">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.conName" placeholder="姓名"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="conPhone" label="电话" align="center">
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.conPhone" placeholder="电话"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="conRmk" label="备注" align="center">
                                <template slot-scope="scope">
                                    <el-input type="textarea" v-model="scope.row.conRmk" placeholder="备注"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作" align="center">
                                <template slot-scope="scope">
                                    <el-button v-if="scope.$index!==0" @click="deleteRow(scope.$index)">删除一行</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="说明:" prop="manuRmk">
                            <el-input type="textarea" v-model="addForm.manuRmk"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="closeAdd">取 消</el-button>
                <el-button type="primary" @click="saveAdd">确 定</el-button>
            </span>
        </el-dialog>

        <!-- 编辑弹出框 -->
        <el-dialog title="编辑" :visible.sync="editVisible" width="20%" :before-close="closeEdit">
            <el-form ref="editForm" :rules="formRules" :model="editForm" label-width="90px">
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="厂家名称:" prop="manuName">
                            <el-input v-model="editForm.manuName"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="厂家地址:" prop="manuAdr">
                            <el-input v-model="editForm.manuAdr"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="说明:" prop="manuRmk">
                            <el-input type="textarea" v-model="editForm.manuRmk"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="closeEdit">取 消</el-button>
                <el-button type="primary" @click="saveEdit">确 定</el-button>
            </span>
        </el-dialog>

        <!-- 操作联系人弹出框 -->
        <el-dialog title="联系人管理" :visible.sync="contactsVisible" width="50%" :before-close="close">
            <Contacts :fkId="fkId" :keyId="timeRefusr"></Contacts>
            <span slot="footer" class="dialog-footer">
                <el-button @click="close">关闭</el-button>
            </span>
        </el-dialog>

        <!--查看产品资质弹出框-->
        <el-dialog title="产品信息" :visible.sync="proVisible" width="60%" :before-close="closePro">
            <el-input v-if="isPro" v-model="proQuery.proName" placeholder="产品名称" class="handle-input mr10"
                      @keyup.enter.native="handleProSearch" style="width: 180px;margin-bottom: 10px"></el-input>
            <el-button v-if="isPro" type="primary" icon="el-icon-search" @click="handleProSearch">搜索</el-button>
            <el-button v-if="isPro" type="el-button" icon="el-icon-delete" @click="handleProReset">重置</el-button>
            <el-table v-if="isPro"
                      :data="proListData"
                      border
                      class="table"
                      ref="proListData"
                      header-cell-class-name="table-header"
            >
                <el-table-column prop="proId" label="产品编号" align="center"></el-table-column>
                <el-table-column prop="proName" label="产品名称" align="center"></el-table-column>
                <el-table-column prop="proNorName" label="产品通用名称" align="center"></el-table-column>
                <el-table-column label="操作" align="center">
                    <template slot-scope="scope">
                        <el-button
                                type="text"
                                icon="el-icon-view"
                                @click="seePro(scope.$index, scope.row)"
                        >查看
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div v-if="isPro" class="pagination">
                <el-pagination
                        background
                        layout="total, prev, pager, next"
                        :current-page="proQuery.pageIndex"
                        :page-size="proQuery.pageSize"
                        :total="proPageTotal"
                        @current-change="handleProPageChange"
                ></el-pagination>
            </div>
            <el-form v-if="isSee" ref="seeForm" :model="seeForm" label-width="100px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="产品名称:" prop="proName">
                            <el-input disabled v-model="seeForm.proName" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="通用名称:" prop="proNorName">
                            <el-input disabled v-model="seeForm.proNorName" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="厂家:" prop="manuName">
                            <el-input disabled v-model="seeForm.manuName" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="型号:" prop="proModel">
                            <el-input disabled v-model="seeForm.proModel" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="出厂价格:" prop="proSupPrice">
                            <el-input disabled type="number" v-model="seeForm.proSupPrice"
                                      style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="市场价格:" prop="proMarPrice">
                            <el-input disabled type="number" v-model="seeForm.proMarPrice"
                                      style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="注册证号码:" prop="proRegNo">
                            <el-input disabled v-model="seeForm.proRegNo" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="技术分类:" prop="typeNm">
                            <el-input disabled v-model="seeForm.typeNm" style="width: 320px"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="供应商:" prop="supIds">
                            <el-checkbox-group v-model="supIds" disabled>
                                <el-checkbox v-for="supplier in suppliers" :label="supplier.supId" :key="supplier.supId"
                                >{{supplier.supName}}
                                </el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="应用科室:" prop="labelIds">
                            <el-checkbox-group v-model="labelIds" disabled>
                                <el-checkbox v-for="labelDic in labelDics" :label="labelDic.labelId"
                                             :key="labelDic.labelId"
                                >{{labelDic.labelNm}}
                                </el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-form-item label="参数:" prop="srmProParaEntitys">
                        <el-table :data="srmSeeProParaList" style="width: 100%"
                                  border>
                            <el-table-column prop="paraNm" label="属性" align="center">
                                <template slot-scope="scope">
                                    <el-input disabled v-model="scope.row.paraNm" placeholder="属性"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="prpaValue" label="值" align="center">
                                <template slot-scope="scope">
                                    <el-input disabled v-model="scope.row.prpaValue" placeholder="值"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column prop="prpaRmk" label="备注" align="center">
                                <template slot-scope="scope">
                                    <el-input disabled type="textarea" v-model="scope.row.prpaRmk"
                                              placeholder="备注"></el-input>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-form-item>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="适应症:" prop="proIndication">
                            <el-input type="textarea" disabled v-model="seeForm.proIndication"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <el-form-item label="说明:" prop="proRmk">
                            <el-input type="textarea" disabled v-model="seeForm.proRmk"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <span slot="footer" v-if="isSee" class="dialog-footer">
                <el-button type="primary" @click="returnPro">返回列表</el-button>
            </span>
            <span slot="footer" v-if="isPro" class="dialog-footer">
                <el-button type="primary" @click="closePro">关闭</el-button>
            </span>
        </el-dialog>

    </div>
</template>

<script>
    import {
        factoryData,
        doAdd,
        selectByManuId,
        doUpdate,
        doDelete,
        excelManu
    } from '../api/factory';
    import {
        selectOnePro, productData
    } from '../api/product';
    import Contacts from '../components/Contacts';
    import Picture from '../components/Picture';
    import BigImg from "../components/BigImg";

    export default {
        name: 'user',
        data() {
            return {
                roleId: localStorage.getItem('ms_roleId'),
                query: {
                    manuName: '',
                    manuAdr: '',
                    pageIndex: 1,
                    pageSize: 10
                },
                proQuery: {
                    manuId: '',
                    proName: '',
                    pageIndex: 1,
                    pageSize: 10
                },
                proPageTotal: 0,
                tableData: [],
                fkId: '',
                timeRefusr: '',
                srmContactsList: [
                    {
                        conName: '',
                        conPhone: '',
                        conRmk: ''
                    }
                ],
                multipleSelection: [],
                editVisible: false,
                addVisible: false,
                contactsVisible: false,
                proVisible: false,
                isPro: true,
                isSee: false,
                proListData: [],
                pageTotal: 0,
                addForm: {},
                editForm: {},
                seeForm: {},
                srmSeeProParaList: [],
                suppliers: [],
                labelDics: [],
                labelIds: [],
                supIds: [],
                idx: -1,
                id: -1,
                showImg: false,
                imgSrc: '',
                formRules: {
                    manuName: [
                        {required: true, message: '请输入厂家名称', trigger: 'blur'},
                    ],
                    manuAdr: [
                        {required: true, message: '请输入厂家地址', trigger: 'blur'},
                    ],
                },
            };
        },
        created() {
            this.getData();
        },
        components: {
            Contacts,
            Picture,
            BigImg,
        },
        methods: {
            // 获取后台数据
            getData() {
                factoryData(this.query).then(res => {
                    if (res.success == true) {
                        this.tableData = res.data;
                        this.pageTotal = res.total;
                    } else {
                        this.$message.error("查询失败！");
                        this.tableData = [];
                        this.pageTotal = 0;
                    }
                });
            },
            // 触发搜索按钮
            handleSearch() {
                this.$set(this.query, 'pageIndex', 1);
                this.getData();
            },
            // 触发重置按钮
            handleReset() {
                this.query.manuName = "";
                this.query.manuAdr = "";
                this.getData();
            },
            // 触发搜索产品按钮
            handleProSearch() {
                this.$set(this.proQuery, 'pageIndex', 1);
                productData(this.proQuery).then(res => {
                    console.log("----proQuery-----", this.proQuery);
                    if (res.success == true) {
                        this.proListData = res.data;
                        this.proPageTotal = res.total;
                    } else {
                        this.$message.error("查询产品信息失败！");
                        this.proListData = [];
                        this.proPageTotal = 0;
                    }
                });
            },
            // 触发重置按钮
            handleProReset() {
                this.proQuery.proName = "";
                productData(this.proQuery).then(res => {
                    console.log("----proQuery-----", this.proQuery);
                    if (res.success == true) {
                        this.proListData = res.data;
                        this.proPageTotal = res.total;
                    } else {
                        this.$message.error("查询产品信息失败！");
                        this.proListData = [];
                        this.proPageTotal = 0;
                    }
                });
            },
            /*新增联系人行数*/
            addLine() {
                console.log("-----新增联系人行数");
                let row = {
                    conName: '',
                    conPhone: '',
                    conRmk: ''
                };
                this.srmContactsList.push(row);
            },
            /*删除联系人行数*/
            deleteRow(i) {
                console.log("-----删除联系人行数", i);
                this.srmContactsList.splice(i, 1);
                console.log("剩余行", this.srmContactsList);
            },
            // 删除操作
            handleDelete(index, row) {
                // 二次确认删除
                this.$confirm('确定要删除吗？', '提示', {
                    type: 'warning'
                })
                    .then(() => {
                        //后台进行删除操作
                        doDelete({"manuId": row.manuId}).then(res => {
                            if (res.success) {
                                this.$message.success('删除成功');
                                this.getData();
                            } else {
                                this.$message.error(res.data);
                                this.getData();
                            }
                        });
                    })
                    .catch(() => {
                        this.$message({
                            message: '已取消删除'
                        });
                    });
            },
            // 多选操作
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            // 新增操作
            handleAdd(index, row) {
                this.addForm = {};
                this.srmContactsList = [
                    {
                        conName: '',
                        conPhone: '',
                        conRmk: ''
                    }
                ];
                this.addVisible = true;
            },
            /*新增用户*/
            saveAdd() {
                this.$refs['addForm'].validate((valid) => {
                    if (valid) {
                        for (let j = 0; j < this.srmContactsList.length; j++) {
                            /*都为空*/
                            if (j == 0 && (this.srmContactsList[j].conName == '' && this.srmContactsList[j].conPhone == '' && this.srmContactsList[j].conRmk == '')) {
                                this.srmContactsList = [];
                            } else {
                                /*填写不完整*/
                                if ((this.srmContactsList[j].conName !== '' && this.srmContactsList[j].conPhone == '') || (this.srmContactsList[j].conName == '' && this.srmContactsList[j].conPhone !== '')) {
                                    this.$message.warning('联系人的姓名和电话请填写完整');
                                    return;
                                }
                                /*都为空*/
                                if (this.srmContactsList[j].conName == '' && this.srmContactsList[j].conPhone == '' && this.srmContactsList[j].conRmk == '') {
                                    this.$message.warning('联系人第' + (j + 1) + '行未填写相关信息，请删除该行');
                                    return;
                                }
                            }
                        }
                        ;
                        this.addForm.srmContactsEntitys = this.srmContactsList;
                        console.log("传入后台的form表单", this.addForm);
                        //新增form表单提交到后台
                        doAdd(this.addForm).then(res => {
                            if (res.success) {
                                this.addVisible = false;
                                this.addForm = {};
                                this.getData();
                                this.$message.success('保存成功');
                            } else {
                                this.$message.error('保存失败');
                            }
                        });
                    }
                });
            },
            closeAdd() {//关闭新增弹出框
                this.$confirm('确认关闭？', '提示', {
                    type: 'warning'
                })
                    .then(() => {
                        this.addVisible = false;
                        this.addForm = {};
                        this.getData();
                    })
                    .catch(() => {
                        this.$message({
                            message: '已取消操作'
                        });
                    });
            },
            // 编辑操作
            async handleEdit(index, row) {
                this.idx = index;
                await selectByManuId({manuId: row.manuId}).then(res => {
                    if (res.success == true) {
                        this.editForm = res.data;
                        this.editVisible = true;
                    } else {
                        this.$message.error('查询失败');
                    }
                });
            },
            closeEdit() {//关闭编辑弹出框
                this.$confirm('确认关闭？', '提示', {
                    type: 'warning'
                })
                    .then(() => {
                        this.editVisible = false;
                        this.editForm = {};
                        this.getData();
                    })
                    .catch(() => {
                        this.$message({
                            message: '已取消操作'
                        });
                    });
            },
            // 保存编辑
            saveEdit() {
                this.$refs['editForm'].validate((valid) => {
                    if (valid) {   //form表单提交到后台
                        console.log("编辑的厂家信息：---", this.editForm);
                        doUpdate(this.editForm).then(res => {
                            if (res.success) {
                                this.editVisible = false;
                                this.editForm = {};
                                this.getData();
                                this.$message.success('编辑成功');
                            } else {
                                this.$message.error('编辑失败');
                            }
                        });
                    }
                });
            },
            // 分页导航
            handlePageChange(val) {
                this.$set(this.query, 'pageIndex', val);
                this.getData();
            },
            /*产品分页导航*/
            handleProPageChange(val) {
                this.$set(this.proQuery, 'pageIndex', val);
                productData(this.proQuery).then(res => {
                    console.log("----proQuery-----", this.proQuery);
                    if (res.success == true) {
                        this.proListData = res.data;
                        this.proPageTotal = res.total;
                    } else {
                        this.$message.error("查询产品信息失败！");
                        this.proListData = [];
                        this.proPageTotal = 0;
                    }
                    this.proVisible = true;
                });
            },
            /*操作联系人*/
            contactsList(index, row) {
                this.fkId = row.manuId;
                this.timeRefusr = new Date().getTime();
                console.log("contactsList查询的ID is=======", this.fkId);
                this.contactsVisible = true;
            },
            /*关闭操作联系人弹出框*/
            close() {
                this.$confirm('确认关闭？', '提示', {
                    type: 'warning'
                })
                    .then(() => {
                        this.contactsVisible = false;
                    })
                    .catch(() => {
                        this.$message({
                            message: '已取消操作'
                        });
                    });
            },
            /*操作供应商*/
            supplierList(index, row) {
                this.$router.push({path: '/supplier', query: {manuId: row.manuId}});
            },
            /*查看产品信息*/
            productList(index, row) {
                console.log("-----manuId----", row.manuId);
                this.proQuery.manuId = row.manuId;
                productData(this.proQuery).then(res => {
                    console.log("----proQuery-----", this.proQuery);
                    if (res.success == true) {
                        this.proListData = res.data;
                        this.proPageTotal = res.total;
                    } else {
                        this.$message.error("查询产品信息失败！");
                        this.proListData = [];
                        this.proPageTotal = 0;
                    }
                    this.proVisible = true;
                });
            },
            /*操作厂家资质*/
            pictureList(index, row) {
                this.$router.push({path: '/picture', query: {fkId: row.manuId}});
            },
            /*查看产品信息*/
            seePro(index, row) {
                console.log("proId", row.proId);
                selectOnePro({proId: row.proId}).then(res => {
                    if (res.success == true) {
                        this.seeForm = res.data;
                        this.suppliers = res.data.srmSupInfoEntitys;
                        this.supIds = res.data.supIds.split(",");
                        this.labelDics = res.data.srmLabelDicEntitys;
                        this.labelIds = res.data.labelIds.split(",");
                        this.srmSeeProParaList = res.data.srmProParaEntitys;
                        this.isPro = false;
                        this.isSee = true;
                    } else {
                        this.$message.error('查询供应商具体信息失败');
                    }
                });
            },
            /*关闭查看供应商弹出框*/
            closePro() {
                this.proVisible = false;
                this.isPro = true;
                this.isSee = false;
            },
            /*返回供应商列表*/
            returnPro() {
                this.isPro = true;
                this.isSee = false;
            },
            /*导出*/
            handleLoading() {
                if (this.multipleSelection.length > 0) {
                    let manuIds=[];
                    for (let i=0;i<this.multipleSelection.length;i++){
                        manuIds.push(this.multipleSelection[i].manuId);
                    }
                    //调用后台 导出
                    console.log("manuIds",manuIds.join(","));
                    window.location.href = "/api/srm/excel/exportManuExcel?manuIds=" + manuIds.join(",");
                }else {
                    this.$message.warning("请选择一个或者多个厂家进行导出");
                }
            },
        }
    };
</script>

<style scoped>
    .handle-box {
        margin-bottom: 20px;
    }

    .handle-select {
        width: 120px;
    }

    .handle-input {
        width: 300px;
        display: inline-block;
    }

    .table {
        width: 100%;
        font-size: 14px;
    }

    .red {
        color: #ff0000;
    }

    .mr10 {
        margin-right: 10px;
    }

    .table-td-thumb {
        display: block;
        margin: auto;
        width: 40px;
        height: 40px;
        /*border-radius 属性允许您为元素添加圆角边框！*/
        border-radius: 6px;
        background-clip: padding-box;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        border-bottom-left-radius: 6px;
    }

    /*头像上传*/
    .user-header {
        position: relative;
        display: inline-block;
    }

    .user-header-com {
        width: 100px;
        height: 100px;
        /*  border-radius: 0%;*/
        display: inline-block;
        margin-left: 10px;
    }

    .header-upload-btn {
        position: absolute;
        left: 0;
        top: 0;
        opacity: 0;
        /* 通过定位把input放在img标签上面，通过不透明度隐藏 */
    }
</style>
